import requests

word = input("请输入要查询的词汇(输入q退出):")

url = 'http://121.41.112.199:8080/genshin/get'
url += "?word=" + word

headers = {"Accept": "application/vnd.github.v3+json"}
data = requests.get(url, headers=headers)
response_dict = data.json()

for item in response_dict["data"]["records"]:
    if item.get("zhCN"): print("\n中文:" + item.get("zhCN"))
    if item.get("en"): print("英文:" + item["en"])
    if item.get("ja"): print("日语:" + item["ja"])
    # 打印标签
    if item.get("tags"):
        # 标签不为空
        print("标签:", end="")
        for tag in item.get("tags"):
            print(tag, end=" ")
        print("")
print("")
